loadf <- TRUE

if (loadf)
  {
    box.data <- list()
    type <- list()
  }

if (loadf)
  {
    load(file="balance3.simsA1.nobs1000.Rdata")
    box.data[[1]] <- as.real(c(genmatch.pvals, logit.pvals, forest.pvals, boost.pvals))
    type[[1]] <- c(rep(1,sims.run), rep(2,sims.run), rep(3,sims.run), rep(4,sims.run))
    box.data[[1]] <- as.data.frame(cbind(as.real(box.data[[1]]), as.factor(type[[1]])))

    load(file="balance3.simsB1.nobs1000.Rdata")
    box.data[[2]] <- as.real(c(genmatch.pvals, logit.pvals, forest.pvals, boost.pvals))
    type[[2]] <- c(rep(1,sims.run), rep(2,sims.run), rep(3,sims.run), rep(4,sims.run))
    box.data[[2]] <- as.data.frame(cbind(as.real(box.data[[2]]), as.factor(type[[2]])))    

    load(file="balance3.simsC1.nobs1000.Rdata")
    box.data[[3]] <- as.real(c(genmatch.pvals, logit.pvals, forest.pvals, boost.pvals))
    type[[3]] <- c(rep(1,sims.run), rep(2,sims.run), rep(3,sims.run), rep(4,sims.run))
    box.data[[3]] <- as.data.frame(cbind(as.real(box.data[[3]]), as.factor(type[[3]])))

    load(file="balance3.simsD1.nobs1000.Rdata")
    box.data[[4]] <- as.real(c(genmatch.pvals, logit.pvals, forest.pvals, boost.pvals))
    type[[4]] <- c(rep(1,sims.run), rep(2,sims.run), rep(3,sims.run), rep(4,sims.run))
    box.data[[4]] <- as.data.frame(cbind(as.real(box.data[[4]]), as.factor(type[[4]])))

    load(file="balance3.simsE1.nobs1000.Rdata")
    box.data[[5]] <- as.real(c(genmatch.pvals, logit.pvals, forest.pvals, boost.pvals))
    type[[5]] <- c(rep(1,sims.run), rep(2,sims.run), rep(3,sims.run), rep(4,sims.run))
    box.data[[5]] <- as.data.frame(cbind(as.real(box.data[[5]]), as.factor(type[[5]])))

    load(file="balance3.simsF1.nobs1000.Rdata")
    box.data[[6]] <- as.real(c(genmatch.pvals, logit.pvals, forest.pvals, boost.pvals))
    type[[6]] <- c(rep(1,sims.run), rep(2,sims.run), rep(3,sims.run), rep(4,sims.run))
    box.data[[6]] <- as.data.frame(cbind(as.real(box.data[[6]]), as.factor(type[[6]])))

    load(file="balance3.simsG1.nobs1000.Rdata")
    box.data[[7]] <- as.real(c(genmatch.pvals, logit.pvals, forest.pvals, boost.pvals))
    type[[7]] <- c(rep(1,sims.run), rep(2,sims.run), rep(3,sims.run), rep(4,sims.run))
    box.data[[7]] <- as.data.frame(cbind(as.real(box.data[[7]]), as.factor(type[[7]])))    
  }

direction <- FALSE
do.list <- c("A","B","C","D","E","F","G")
ylim <- c(.6, .6, .4, .5, .5, .5, .17)
tfoo <- paste("balance3.combine1a.nobs1000.pdf")
pdf(file=tfoo)    
for (i in 1:length(do.list))
  {
    boxplot(V1~V2, data=box.data[[i]], names=c("GM","LGR","RFRST","BOOST"), ylab="p-values",
        ylim=c(0,ylim[i]),        
        horizontal=direction)
  }
dev.off()


direction <- FALSE
do.list <- c("A","B","C","D","E","F","G")
ylim <- c(.6, .6, .4, .5, .5, .5, .17)
for (i in 1:length(do.list))
  {
    tfoo <- paste("balance3_combine1_nobs1000_exp",do.list[i],".pdf",sep="")
    print(tfoo)
    pdf(file=tfoo)    
    boxplot(V1~V2, data=box.data[[i]], names=c("GM","LGR","RFRST","BOOST"), ylab="p-values",
        ylim=c(0,ylim[i]),        
        horizontal=direction)
    dev.off()
  }

